package cn.com.eado.crm.app.extenstion

import android.app.Activity
import android.view.View
import android.view.WindowManager
import android.widget.ProgressBar

fun ProgressBar.show(activity: Activity?){
    activity?.window?.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE, WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE)  //ProgressBar使VISIBLE时其它控件不能操作
    visibility = View.VISIBLE
}

fun ProgressBar.hide(activity: Activity?){
    activity?.window?.clearFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE)  //恢复其它控件能操作
    visibility = View.GONE
}